<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
  <head>
  <style>
.fontdaxiao {
	font-size: 12px;
}

.tableAF {
	
}

.tableAF tr th {
	border: 1px;
	border-color: #EDEDED;
	border-style: solid;
}

.tableAF tr td {
	border: 1px;
	border-top: 0px;
	border-color: #EDEDED;
	border-style: solid;
}

.rowsOne {
	background-color: white;
}

.rowsTwo {
	background-color: #7CC5E5;
}

.rowsThree {
	background-color: #F5F5F5;
}
.diva{
	width:98%;
	position:relative;
	margin:0px auto;
	text-align:center;
    border:1px solid #ccc;
}
.divb{
	display:inline-block;
    *display:inline;
    zoom:1;
	width:40px;
	height:20px;	
	margin:10px;
	line-height:18px;
	text-align:center;
}
</style>
<script type="text/javascript">
function chooseChannelName(trNum) {
	var a = document.getElementById("channelTableABC");
	for ( var i = 1; i < a.rows.length; i++) {
		a.rows[i].className = "rowsOne";
	}
	trNum.className = "rowsTwo";
	parent.$.returnValue = trNum.cells[4].innerHTML;
}
function trMouseOver(trNum) {
	if (trNum.className != "rowsTwo") {
		trNum.className = "rowsThree";
	}
}
function trMouseOut(trNum) {
	if (trNum.className != "rowsTwo") {
		trNum.className = "rowsOne";
	}
}

function queryChannelPrice() {
	var a = document.getElementById("channelbody");
	var rowLen = a.rows.length;
	for(var i=0;i<rowLen;i++){
		a.deleteRow(i);
		rowLen--;
		i--;
	}
	$.post("../portsJson!findDepartturePort.action", {
		"portSeachBean.clinentPortCountry" : document.getElementById("port_country").value,
		"portSeachBean.clinentPortCn" : document.getElementById("port_name").value,	//中英文都存在'中文名'..
		"portSeachBean.clinentPortCode" : document.getElementById("port_code").value
	}, function(data){
		$(data).each(function(){
			var na = a.insertRow(0);
			var na1 = na.insertCell(0);
			var na2 = na.insertCell(0);
			var na3 = na.insertCell(0);
			var na4 = na.insertCell(0);
			var na5 = na.insertCell(0);
			na1.setAttribute("align","center");
			na1.innerHTML = this.clinentPortCode;
			na2.setAttribute("align","center");
			na2.innerHTML = this.clinentPortEn;
			na3.setAttribute("align","center");
			na3.innerHTML = this.clinentPortCn;
			na4.setAttribute("align","center");
			na4.innerHTML = this.clinentPortCity;
		 	na5.innerHTML = this.clinentPortCountry;
		 	na5.setAttribute("align","center");
			na.onclick = function(){
				chooseChannelName(na);
			}
			na.onmouseover = function(){
				trMouseOver(na);
			}
			na.onmouseout = function(){
				trMouseOut(na);
			}
			//na.setAttribute("onclick","chooseChannelName(this)");
			//na.setAttribute("onmouseover","trMouseOver(this)");
			//na.setAttribute("onmouseout","trMouseOut(this)");
		});
	});
}

</script>
  
  </head>
  <body>

<div class="pageHeader">
	<div class="">
		<label class="fontdaxiao">
			所属国家：
		</label>
		<input id="port_country" type="text" size="12" class="fontdaxiao" />
		<label class="fontdaxiao">
			机场名(中,英)：
		</label>
		<input id="port_name" type="text" size="12" class="fontdaxiao" />
		<label class="fontdaxiao">
			机场三字码：
		</label>
		<input id="port_code" type="text" size="12" class="fontdaxiao" />
		<button type="submit" class="fontdaxiao" onclick="queryChannelPrice()">
			查询
		</button>
	</div>
</div>
<div class="pageContent">
	<table id="channelTableABC" width="100%" layoutH="65"
		class="tableAF fontdaxiao" cellpadding="0px" cellspacing="0">
		<thead>
			<tr style="background-image: url('../../aoll81.jpg')">
				<th width="20%" align="center">
					所属国家
				</th>
				<th width="20%" align="center">
					所属城市
				</th>
				<th width="20%" align="center">
					机场中文名
				</th>
				<th width="20%" align="center">
					机场英文名
				</th>
				<th width="20%" align="center">
					机场三字代码
				</th>
			</tr>
		</thead>
		<tbody id="channelbody">

		</tbody>
	</table>
</div>
<div class="diva">
<div class="divb">首页</div><div class="divb">a</div><div class="divb">尾页</div><div class="divb">尾页</div><div class="divb">尾页</div><div class="divb">尾页</div>
</div>
</body>
</html>